import { BaseEntity } from '@cool-midway/core';
import { Column, Entity } from 'typeorm';

@Entity('dr_daily_report') // 可以指定表名，不指定会根据类名自己生成
export class DailyReport extends BaseEntity {
  @Column()
  order_number: string = null;

  @Column({
    nullable: false,
  })
  product_info: string;

  @Column({
    nullable: false,
  })
  status: string;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  actual_discount_amount_by_merchant: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  payment_cost: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  actual_platform_discount: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  actual_discounts_for_influencer: number;

  @Column({
    nullable: false,
  })
  order_num: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  store_name;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  oreder_revenue: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  oreder_cost: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  platform_service_fee: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  commission: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  service_fee: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  erp_cost: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  order_payable_amount: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  profit: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  product_cost: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  rebate: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  extra_cost: number;

  @Column({
    nullable: false,
    type: 'date',
  })
  data_date: Date;
}
